import request from '@/utils/request'

// BOM产品列表
export function fetchProList(params) {
  return request({
    url: '/operation/opBomProduct/queryList',
    method: 'get',
    params: {
      'isProduct':params.isProduct,
      'companyId': params.companyId,
      'companyName': params.companyName,
      'pageIndex': params.pageIndex,
      'pageSize': params.pageSize
    },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqGet'

  })
}

// BOM产品详情
export function fetchProDetail(id) {
  return request({
    url: '/operation/opBomProduct/detail',
    method: 'get',
    params: { id },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqGet'

  })
}

// 删除BOM产品
export function fetchProDelete(id) {
  return request({
    url: '/operation/opBomProduct/delete',
    method: 'delete',
    params: { id },
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqDelete'

  })
}

// 添加BOM产品
export function createProAdd(data) {
  return request({
    url: '/operation/opBomProduct/add',
    method: 'post',
    data,
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqPost'

  })
}

// 修改BOM产品
export function updateProArticle(data) {
  return request({
    url: '/operation/opBomProduct/update',
    method: 'put',
    data,
    port: { ENV_PORT: 8004 },
    ajaxType2: 'reqPut'

  })
}
